<template>
	<view class="page-box body_box">
		<view class="user-box row-box">
			<view class="header-box">
				<u--image :src="header" shape="circle" width="120rpx" height="120rpx"></u--image>
			</view>
			<view style="margin-left: 20rpx;line-height: 60rpx;">
				<view class="row-box center-box">
					<view style="font-weight: 900;font-size: 42rpx;">{{userInfo.nickName}}</view>
					<view class="row-box center-box user-icon-box">
						<view style="background-color: #fff;width: 42rpx;height: 42rpx;border-radius: 21rpx;" class="center-box">
							<u--image :src="userUrl" width="36rpx" height="36rpx"></u--image>
						</view>
						<view style="margin-left: 10rpx;margin-right: 16rpx;font-size: 26rpx;color: #606266;">报价师</view>
					</view>
				</view>
				<view>{{userInfo.recoveryName}}</view>
			</view>
		</view>
		
		<view class="row-box">
			<!-- 资金组件 -->
			<view class="fund_box" @click="gotoWalletLog">
				<view class="row-box">
					<text style="font-size: 36rpx;font-weight: 900;">资金池 </text>
					<text style="opacity:0">H</text>
					<text style="font-size: 24rpx;">(线上支付)</text>
					<view style="margin-left: 24%;" class="center-box">
						<u-icon name="arrow-right" color="#502b18"></u-icon>
					</view>
				</view>
				<view>{{walletInfo.money}}</view>
				<view style="font-size: 28rpx;">今日支出{{walletInfo.expend}}元</view>
			</view>
			
			<!-- 收货组件 -->
			<view class="collect-box">
				<view class="row-box">
					<view style="font-size: 32rpx;font-weight: 900;">收货次数</view>
					<view style="margin-left: 24%;" class="center-box">
						<u-icon name="arrow-right" color="#fff"></u-icon>
					</view>
				</view>
				<view>5000</view>
				<view>每成交1单扣1次</view>
			</view>
		</view>
		
		<view class="order-line">
			<view class="h2-font">个人订单</view>
			<view class="row-box" style="margin-top: 30rpx;">
				<view  v-for="it in orderList" class="item-box" @click="gotoOrderList(it.type)">
					<view>
						<image class="icon_img_max" :src="it.url"></image>
						<view>{{it.text}}</view>
					</view>
				</view>
				
			</view>
		</view>
		
		<my-oher></my-oher>
	</view>
</template>

<script>
	import myOher from "@/pages/public/my-other.vue"
	export default {
		components: {myOher},
		data() {
			return {
				walletInfo: {
					money: 0,
					expend: 0
				},
				userInfo: uni.getStorageSync(this.$constant.ROLE_INFO_KEY),
				header: require("@/static/header.jpg"),
				userUrl: require("@/static/img/user.png"),
				/* 订单步骤 */
				orderList: [
					{
						text: "已报价",
						url: require("@/static/img/order/yb.png"),
						number: 0,
						type: 2
					},
					{
						text: "待收货",
						url: require("@/static/img/order/dsh.png"),
						type: 3
					},
					{
						text: "已退单",
						url: require("@/static/img/order/bh.png"),
						type: 4
					},
					{
						text: "未成交",
						url: require("@/static/img/order/yc.png"),
						type: 5
					}
				]
			}
		},
		created() {
			this.init();
		},
		methods: {
			init() {
				this.$request("/wallet/detail", "get").then(res => {
					this.walletInfo.money = res.data.wallet.money;
					this.walletInfo.expend = res.data.expend ? res.data.expend : 0;
					this.wallet = res.data.wallet;
				})
			},
			gotoOrderList(e) {
				uni.navigateTo({
					url: "/pages/public/order-list?type=" + e
				})
			},
			gotoWalletLog() {
				uni.navigateTo({
					url: "/pages/public/wallet-log"
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page-box {
		background-image: linear-gradient(to top left, #f2f8fc 30%, #dbf6fe);
		height: 100vh;
	}
	.user-box {
		margin-top: 100rpx;
		margin-left: 20rpx;
	}
	.user-icon-box {
		height: 42rpx;
		border-radius: 21rpx;
		background-image: linear-gradient(#dbf1e1, #71d5a1);
		margin-left: 15rpx;
	}
	.order-line{
		background-color: #fff;
		margin-top: 30rpx;
		padding: 40rpx 30rpx;
		border-radius: 20rpx;
		.item-box {
			width: 25%;
			text-align: center;
			font-size: 24rpx;
		}
	}
	.menus_box{
		width: 25%;
		text-align: center;
		font-size: 26rpx;
		line-height: 58rpx;
		margin-top: 40rpx;
	}
	.other-box {
		background-color: #FFF;
		margin-top: 30rpx;
		padding: 20rpx;
		border-radius: 20rpx;
	}
	.fund_box {
		background-image: linear-gradient(to right, #fef3e0, #fbdaa7);
		margin-top: 30rpx;
		width: 50vw;
		padding: 20rpx;
		border-radius: 20rpx;
		line-height: 60rpx;
		color: #502b18;
	}
	.collect-box {
		background-image: linear-gradient(to right, #3c9ee8, #6ed9f6);
		margin-top: 30rpx;
		width: 30vw;
		padding: 20rpx;
		border-radius: 20rpx;
		line-height: 60rpx;
		margin-left: 30rpx;
		color: #FFF;
		font-size: 28rpx;
	}
</style>
